<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title><?php echo ($title); ?></title>
    <link rel="stylesheet" href="/Public/web/css/pintuer.css">
    <link rel="stylesheet" href="/Public/web/css/admin.css">
    <script src="/Public/web/js/jquery.js"></script>
    <script src="/Public/web/js/pintuer.js"></script>
</head>


<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> <?php echo L("shangpinfenlei");?></strong></div>
    <div class="padding border-bottom">
      <a class="button border-main icon-plus-square-o" href="<?php echo U('Tablecate/addTable');?>"> <?php echo L("tianjia");?></a>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="10%"><?php echo L("canzhuoleixing");?></th>
        <th width="20%"><?php echo L("kezuorenshu");?></th>
        <th width="10%"><?php echo L("caozuo");?></th>
      </tr>
      <?php if(is_array($list)): foreach($list as $key=>$v): ?><tr class="o<?php echo ($v['table_cate_id']); ?>">
          <td><?php echo ($v['table_cate_name']); ?></td>
          <td><?php echo ($v['sit_people']); ?></td>
          <td>
            <div class="button-group">
              <a class="button border-main" href="<?php echo U('Tablecate/edit',array('id'=>$v['table_cate_id']));?>"><span class="icon-edit"></span> <?php echo L("bianji");?></a>
              <a class="button border-red" href="javascript:void(0)" onclick="return del(<?php echo ($v['table_cate_id']); ?>)"><span class="icon-trash-o"></span> <?php echo L("shanchu");?></a>
            </div>
          </td>
        </tr><?php endforeach; endif; ?>
    </table>
  </div>
  <script type="text/javascript">
    function del(id){
      if(confirm("<?php echo L('shanchuxiaoxi');?>")){
        var url = "<?php echo U('Tablecate/delete');?>";
        $.getJSON(url,{id:id},function (data){
          if(data.result == 'tp1'){$(".o"+id).remove();}
          else if(data.result == 'break'){alert('ERROR.');}
        })
      }
    }
  </script>
</body>

</html>